<?php
	include("connect.php");
	$css = '<link rel="stylesheet" type="text/css" media="all" href="asset/css/class_sellbook.css"><script type="text/javascript" src="asset/js/jquery-1.4.2.min.js"></script>';
	$title = 'Advance Search';
	$page_name = 'advanced_search';

$sql = "select user_category from m_user where user_id=".$_SESSION['userid'];
$retval = mysql_query( $sql, $con );
while($row = mysql_fetch_array($retval))
	{
		$user_category = $row[0];
	}
if(isset($_SESSION["userid"]))
	{
		if($user_category ==9)
		{
			include("header_loggedinadmin.php");
		}else
		{
			include("header_loggedin.php");
		}
	}
else
{
	include("header.php");
}
	
?>

<div id="blue_bg">
	<div id="main">
        <div class="wrapper">
        	<div id="content">
            	<div id="white_box">
                	<h3 class="flag_long">ADVANCED SEARCH</h3>
                    <table>
                    <?php
					/*//retrieve category
					$sql = 'SELECT category_detail_name FROM t_detail_category GROUP BY category_detail_name';
					if (!mysql_query($sql,$con))
					{
						die('Error: ' . mysql_error());
					}*/
                    echo '
					<form action="book_to_sell.php" method="get">
                        <tr>
                            <td>Title</td>
                            <td width="50px"></td>
                            <td><input type="text" name="title" size="50" /></td>
                        </tr>
                        <tr>
                            <td>Author</td>
                            <td width="50px"></td>
                            <td><input type="text" name="author" size="50" /></td>
                        </tr>
						
                        <tr>
                            <td>Price Range</td>
                            <td width="50px"></td>
                            <td><input type="text" name="price_min" size="10" /> - <input type="text" name="price_max" size="10" /></td>
                        </tr>';
						/*
                        <tr>
                            <td>Category</td>
                            <td width="50px"></td>
                            <td>
                                <select name="course">
                                    <option value="course">course</option>
                                    <option value="MIT">MIT</option>
                                </select>
                                &nbsp;&nbsp;
                                <select name="category">
                                    <option value="category">category</option>
									';
									while($row = mysql_fetch_array($retval))
									{
                                    echo '<option value="' .$row['category_detail_name'] . '">' .$row['category_detail_name'] . '</option>';
									}
					
                                </select>
						
                            </td>
                        </tr>
						*/
						echo '
                        <tr>
                            <td></td>
                            <td width="50px"></td>
                            <td><input type="submit" value="" id="submit_btn" /></td>
                        </tr>
					</form>
						';
						?>
                    </table>
           		</div>
            </div>
        </div>
    </div>
</div>
<?php
include("footer.php");
?>

